/* 文档表单页面样式优化 */
.add-document-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 0;
  background-color: #f9fafb;
  overflow: hidden;
  width: 100%;
}

.add-document-header {
  display: flex;
  align-items: center;
  padding: 16px 24px;
  background-color: white;
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 10;
  gap: 16px;
  width: 100%;
}

.add-document-header h2 {
  flex: 1;
  font-size: 20px;
  font-weight: 600;
  color: var(--text-color);
  margin: 0;
  text-align: center;
}

.add-document-form {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  box-sizing: border-box;
}

/* 表单组样式优化 */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
  width: 100%;
}

.form-group label {
  font-weight: 500;
  color: var(--text-color);
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-group label i {
  color: var(--primary-color);
  font-size: 16px;
}

.form-group input[type="text"],
.form-group textarea {
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-color);
  background-color: white;
  transition: all 0.2s;
  resize: vertical;
  box-shadow: var(--shadow-sm);
  width: 100%;
  box-sizing: border-box;
}

.form-group input[type="text"]:focus,
.form-group textarea:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.15);
  outline: none;
}

.form-group input[type="text"] {
  height: 48px;
}

.form-group textarea {
  min-height: 200px;
}

/* 文本计数器 */
.text-counter {
  font-size: 13px;
  color: var(--text-secondary);
  text-align: right;
  margin-top: 4px;
}

.text-counter.warning {
  color: #f59e0b;
}

.text-counter.danger {
  color: #ef4444;
}

/* 输入方法选择选项卡 */
.method-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  background-color: white;
  padding: 6px;
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  width: 100%;
  box-sizing: border-box;
}

.method-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.2s;
  flex: 1;
  justify-content: center;
}

.method-tab:hover {
  background-color: #f5f7ff;
  color: var(--primary-color);
}

.method-tab.active {
  background-color: var(--primary-color);
  color: white;
  box-shadow: var(--shadow-sm);
}

.method-tab i {
  font-size: 18px;
}

/* 输入方法内容容器 */
.input-method-content {
  background-color: white;
  border-radius: 12px;
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  animation: fadeIn 0.3s ease-out;
  width: 100%;
  box-sizing: border-box;
  margin: 0 auto;
}

/* 文件上传区域 */
.file-upload-area {
  border: 2px dashed var(--border-color);
  border-radius: 12px;
  padding: 30px 20px;
  text-align: center;
  background-color: #f9fafb;
  transition: all 0.2s;
  cursor: pointer;
}

.file-upload-area:hover {
  border-color: var(--primary-color);
  background-color: #f5f7ff;
}

.file-upload-area.dragover {
  border-color: var(--primary-color);
  background-color: rgba(67, 97, 238, 0.05);
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.15);
}

.file-upload-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.file-upload-label i {
  font-size: 36px;
  color: var(--primary-color);
}

.file-upload-label span {
  color: var(--text-color);
  font-size: 16px;
  font-weight: 500;
}

.file-upload-label .file-types-hint {
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: normal;
}

.file-upload-label a {
  color: var(--primary-color);
  text-decoration: none;
  font-size: 14px;
  margin-top: 8px;
}

.file-upload-label a:hover {
  text-decoration: underline;
}

input[type="file"] {
  display: none;
}

/* 已选择文件信息 */
.file-info {
  margin-top: 20px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  overflow: hidden;
  background-color: white;
  box-shadow: var(--shadow-sm);
  animation: fadeIn 0.3s ease-out;
}

.file-info-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
  background-color: #f9fafb;
}

.file-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.file-name {
  font-weight: 500;
  font-size: 16px;
  color: var(--text-color);
  display: flex;
  align-items: center;
  gap: 8px;
}

.file-name i {
  color: var(--primary-color);
}

.file-size {
  font-size: 13px;
  color: var(--text-secondary);
}

.remove-file-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #fee2e2;
  color: #ef4444;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.remove-file-btn:hover {
  background-color: #fecaca;
  transform: scale(1.1);
}

/* 文件预览 */
.file-preview-container {
  padding: 20px;
  max-height: 300px;
  overflow-y: auto;
}

.file-preview-header {
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}

.file-preview-header h4 {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-color);
  margin: 0;
}

.file-content-preview {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-color);
}

/* 预览按钮 */
.preview-btn {
  position: absolute;
  right: 30px;
  top: 144px; /* 调整位置更合适 */
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 6px;
  background-color: white;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  z-index: 5;
}

.preview-btn:hover {
  background-color: #f5f7ff;
  color: var(--primary-color);
  border-color: rgba(67, 97, 238, 0.3);
}

/* Markdown预览 */
.markdown-preview {
  margin-top: 20px;
  background-color: white;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  width: 100%;
  box-sizing: border-box;
}

.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
  background-color: #f9fafb;
  width: 100%;
  box-sizing: border-box;
}

.preview-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
  color: var(--text-color);
}

.close-preview-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f1f5f9;
  color: var(--text-secondary);
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.close-preview-btn:hover {
  background-color: #e2e8f0;
}

.preview-content {
  padding: 20px;
  max-height: 400px;
  overflow-y: auto;
  line-height: 1.6;
  width: 100%;
  box-sizing: border-box;
}

/* 表单操作按钮 */
.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
  width: 100%;
  box-sizing: border-box;
}

.primary-btn,
.secondary-btn,
.danger-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
}

.primary-btn {
  background-color: var(--primary-color);
  color: white;
  border: none;
  box-shadow: 0 2px 4px rgba(67, 97, 238, 0.3);
}

.primary-btn:hover {
  background-color: #3850d0;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(67, 97, 238, 0.4);
}

.secondary-btn {
  background-color: white;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.secondary-btn:hover {
  background-color: #f5f7ff;
  color: var(--primary-color);
  border-color: rgba(67, 97, 238, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.danger-btn {
  background-color: white;
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.danger-btn:hover {
  background-color: #fee2e2;
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(239, 68, 68, 0.2);
}

/* 响应式调整 */
@media (max-width: 768px) {
  .add-document-form {
    padding: 16px;
  }
  
  .method-tabs {
    flex-direction: column;
    padding: 4px;
  }
  
  .method-tab {
    padding: 10px 16px;
  }
  
  .input-method-content {
    padding: 16px;
  }
  
  .form-actions {
    flex-direction: column;
  }
  
  .primary-btn,
  .secondary-btn,
  .danger-btn {
    width: 100%;
    justify-content: center;
  }
  
  .preview-btn {
    right: 16px;
    top: 16px;
  }
}

/* 针对较大屏幕的调整 */
@media (min-width: 1400px) {
  .add-document-form {
    max-width: 1400px;
  }
  
  .form-group textarea {
    min-height: 300px;
  }
}

/* 加载状态和错误提示 */
.form-loading {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10;
}

.form-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(67, 97, 238, 0.1);
  border-radius: 50%;
  border-top: 4px solid var(--primary-color);
  animation: spin 1s linear infinite;
}

.form-error {
  color: #ef4444;
  font-size: 14px;
  padding: 8px 12px;
  background-color: #fee2e2;
  border-radius: 6px;
  margin-top: 4px;
}

/* 文件类型标签 */
.file-type-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 4px;
  margin-left: 8px;
}

.file-type-badge.pdf {
  background-color: #fee2e2;
  color: #ef4444;
}

.file-type-badge.word {
  background-color: #e0f2fe;
  color: #0ea5e9;
}

.file-type-badge.excel {
  background-color: #dcfce7;
  color: #16a34a;
}

.file-type-badge.image {
  background-color: #fef3c7;
  color: #d97706;
}

.file-type-badge.text {
  background-color: #f3e8ff;
  color: #9333ea;
}

/* 支持的文件类型列表 */
.supported-files-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.file-type-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 8px;
  border-radius: 8px;
  background-color: white;
  border: 1px solid var(--border-color);
  text-align: center;
}

.file-type-item i {
  font-size: 24px;
  color: var(--primary-color);
}

.file-type-item .ext {
  font-weight: 500;
  color: var(--text-color);
}

.file-type-item .desc {
  font-size: 12px;
  color: var(--text-secondary);
} 